 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

JDCloud Redis API
京东云缓存Redis相关接口

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKRedis/RedisExecutor.h>

@implementation RedisClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"redis.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 redis  v1";
    _serviceName = @"redis";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 redis  v1";
    _serviceName = @"redis";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"redis.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 redis  v1";
    _serviceName = @"redis";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 redis  v1";
    _serviceName = @"redis";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
modifyBackupPolicy sync request
@param modifyBackupPolicyRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyBackupPolicyResponse` the request response data model
*/
-(NSDictionary*) modifyBackupPolicySyncWithRequest:(RedisModifyBackupPolicyRequest*) modifyBackupPolicyRequest
{
RedisModifyBackupPolicyExecutor* excutor = [[RedisModifyBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyBackupPolicyRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyBackupPolicyResponse* response = [[RedisModifyBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyBackupPolicyResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyBackupPolicyAsyncWithRequest:(RedisModifyBackupPolicyRequest*) modifyBackupPolicyRequest
                       completionHandler:(void(^)(int statusCode,RedisModifyBackupPolicyResponse* _Nullable modifyBackupPolicyResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisModifyBackupPolicyExecutor* excutor = [[RedisModifyBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyBackupPolicyRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyBackupPolicyResponse* response = [[RedisModifyBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
modifyCacheInstanceClass sync request
@param modifyCacheInstanceClassRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyCacheInstanceClassResponse` the request response data model
*/
-(NSDictionary*) modifyCacheInstanceClassSyncWithRequest:(RedisModifyCacheInstanceClassRequest*) modifyCacheInstanceClassRequest
{
RedisModifyCacheInstanceClassExecutor* excutor = [[RedisModifyCacheInstanceClassExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyCacheInstanceClassRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyCacheInstanceClassResponse* response = [[RedisModifyCacheInstanceClassResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyCacheInstanceClassResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyCacheInstanceClassAsyncWithRequest:(RedisModifyCacheInstanceClassRequest*) modifyCacheInstanceClassRequest
                       completionHandler:(void(^)(int statusCode,RedisModifyCacheInstanceClassResponse* _Nullable modifyCacheInstanceClassResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisModifyCacheInstanceClassExecutor* excutor = [[RedisModifyCacheInstanceClassExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyCacheInstanceClassRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyCacheInstanceClassResponse* response = [[RedisModifyCacheInstanceClassResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createBackup sync request
@param createBackupRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createBackupResponse` the request response data model
*/
-(NSDictionary*) createBackupSyncWithRequest:(RedisCreateBackupRequest*) createBackupRequest
{
RedisCreateBackupExecutor* excutor = [[RedisCreateBackupExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createBackupRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisCreateBackupResponse* response = [[RedisCreateBackupResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createBackupResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createBackupAsyncWithRequest:(RedisCreateBackupRequest*) createBackupRequest
                       completionHandler:(void(^)(int statusCode,RedisCreateBackupResponse* _Nullable createBackupResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisCreateBackupExecutor* excutor = [[RedisCreateBackupExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createBackupRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisCreateBackupResponse* response = [[RedisCreateBackupResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeInstanceConfig sync request
@param describeInstanceConfigRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeInstanceConfigResponse` the request response data model
*/
-(NSDictionary*) describeInstanceConfigSyncWithRequest:(RedisDescribeInstanceConfigRequest*) describeInstanceConfigRequest
{
RedisDescribeInstanceConfigExecutor* excutor = [[RedisDescribeInstanceConfigExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeInstanceConfigRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeInstanceConfigResponse* response = [[RedisDescribeInstanceConfigResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeInstanceConfigResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeInstanceConfigAsyncWithRequest:(RedisDescribeInstanceConfigRequest*) describeInstanceConfigRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeInstanceConfigResponse* _Nullable describeInstanceConfigResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeInstanceConfigExecutor* excutor = [[RedisDescribeInstanceConfigExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeInstanceConfigRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeInstanceConfigResponse* response = [[RedisDescribeInstanceConfigResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeBackupPolicy sync request
@param describeBackupPolicyRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeBackupPolicyResponse` the request response data model
*/
-(NSDictionary*) describeBackupPolicySyncWithRequest:(RedisDescribeBackupPolicyRequest*) describeBackupPolicyRequest
{
RedisDescribeBackupPolicyExecutor* excutor = [[RedisDescribeBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeBackupPolicyRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeBackupPolicyResponse* response = [[RedisDescribeBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeBackupPolicyResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeBackupPolicyAsyncWithRequest:(RedisDescribeBackupPolicyRequest*) describeBackupPolicyRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeBackupPolicyResponse* _Nullable describeBackupPolicyResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeBackupPolicyExecutor* excutor = [[RedisDescribeBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeBackupPolicyRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeBackupPolicyResponse* response = [[RedisDescribeBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteCacheInstance sync request
@param deleteCacheInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteCacheInstanceResponse` the request response data model
*/
-(NSDictionary*) deleteCacheInstanceSyncWithRequest:(RedisDeleteCacheInstanceRequest*) deleteCacheInstanceRequest
{
RedisDeleteCacheInstanceExecutor* excutor = [[RedisDeleteCacheInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteCacheInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDeleteCacheInstanceResponse* response = [[RedisDeleteCacheInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteCacheInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteCacheInstanceAsyncWithRequest:(RedisDeleteCacheInstanceRequest*) deleteCacheInstanceRequest
                       completionHandler:(void(^)(int statusCode,RedisDeleteCacheInstanceResponse* _Nullable deleteCacheInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDeleteCacheInstanceExecutor* excutor = [[RedisDeleteCacheInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteCacheInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDeleteCacheInstanceResponse* response = [[RedisDeleteCacheInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
resetCacheInstancePassword sync request
@param resetCacheInstancePasswordRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `resetCacheInstancePasswordResponse` the request response data model
*/
-(NSDictionary*) resetCacheInstancePasswordSyncWithRequest:(RedisResetCacheInstancePasswordRequest*) resetCacheInstancePasswordRequest
{
RedisResetCacheInstancePasswordExecutor* excutor = [[RedisResetCacheInstancePasswordExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:resetCacheInstancePasswordRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisResetCacheInstancePasswordResponse* response = [[RedisResetCacheInstancePasswordResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"resetCacheInstancePasswordResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)resetCacheInstancePasswordAsyncWithRequest:(RedisResetCacheInstancePasswordRequest*) resetCacheInstancePasswordRequest
                       completionHandler:(void(^)(int statusCode,RedisResetCacheInstancePasswordResponse* _Nullable resetCacheInstancePasswordResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisResetCacheInstancePasswordExecutor* excutor = [[RedisResetCacheInstancePasswordExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:resetCacheInstancePasswordRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisResetCacheInstancePasswordResponse* response = [[RedisResetCacheInstancePasswordResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeSlowLog sync request
@param describeSlowLogRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeSlowLogResponse` the request response data model
*/
-(NSDictionary*) describeSlowLogSyncWithRequest:(RedisDescribeSlowLogRequest*) describeSlowLogRequest
{
RedisDescribeSlowLogExecutor* excutor = [[RedisDescribeSlowLogExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeSlowLogRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeSlowLogResponse* response = [[RedisDescribeSlowLogResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeSlowLogResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeSlowLogAsyncWithRequest:(RedisDescribeSlowLogRequest*) describeSlowLogRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeSlowLogResponse* _Nullable describeSlowLogResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeSlowLogExecutor* excutor = [[RedisDescribeSlowLogExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeSlowLogRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeSlowLogResponse* response = [[RedisDescribeSlowLogResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createCacheInstance sync request
@param createCacheInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createCacheInstanceResponse` the request response data model
*/
-(NSDictionary*) createCacheInstanceSyncWithRequest:(RedisCreateCacheInstanceRequest*) createCacheInstanceRequest
{
RedisCreateCacheInstanceExecutor* excutor = [[RedisCreateCacheInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createCacheInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisCreateCacheInstanceResponse* response = [[RedisCreateCacheInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createCacheInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createCacheInstanceAsyncWithRequest:(RedisCreateCacheInstanceRequest*) createCacheInstanceRequest
                       completionHandler:(void(^)(int statusCode,RedisCreateCacheInstanceResponse* _Nullable createCacheInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisCreateCacheInstanceExecutor* excutor = [[RedisCreateCacheInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createCacheInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisCreateCacheInstanceResponse* response = [[RedisCreateCacheInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
restoreInstance sync request
@param restoreInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `restoreInstanceResponse` the request response data model
*/
-(NSDictionary*) restoreInstanceSyncWithRequest:(RedisRestoreInstanceRequest*) restoreInstanceRequest
{
RedisRestoreInstanceExecutor* excutor = [[RedisRestoreInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:restoreInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisRestoreInstanceResponse* response = [[RedisRestoreInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"restoreInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)restoreInstanceAsyncWithRequest:(RedisRestoreInstanceRequest*) restoreInstanceRequest
                       completionHandler:(void(^)(int statusCode,RedisRestoreInstanceResponse* _Nullable restoreInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisRestoreInstanceExecutor* excutor = [[RedisRestoreInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:restoreInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisRestoreInstanceResponse* response = [[RedisRestoreInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeUserQuota sync request
@param describeUserQuotaRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeUserQuotaResponse` the request response data model
*/
-(NSDictionary*) describeUserQuotaSyncWithRequest:(RedisDescribeUserQuotaRequest*) describeUserQuotaRequest
{
RedisDescribeUserQuotaExecutor* excutor = [[RedisDescribeUserQuotaExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeUserQuotaRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeUserQuotaResponse* response = [[RedisDescribeUserQuotaResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeUserQuotaResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeUserQuotaAsyncWithRequest:(RedisDescribeUserQuotaRequest*) describeUserQuotaRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeUserQuotaResponse* _Nullable describeUserQuotaResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeUserQuotaExecutor* excutor = [[RedisDescribeUserQuotaExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeUserQuotaRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeUserQuotaResponse* response = [[RedisDescribeUserQuotaResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeDownloadUrl sync request
@param describeDownloadUrlRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeDownloadUrlResponse` the request response data model
*/
-(NSDictionary*) describeDownloadUrlSyncWithRequest:(RedisDescribeDownloadUrlRequest*) describeDownloadUrlRequest
{
RedisDescribeDownloadUrlExecutor* excutor = [[RedisDescribeDownloadUrlExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeDownloadUrlRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeDownloadUrlResponse* response = [[RedisDescribeDownloadUrlResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeDownloadUrlResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeDownloadUrlAsyncWithRequest:(RedisDescribeDownloadUrlRequest*) describeDownloadUrlRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeDownloadUrlResponse* _Nullable describeDownloadUrlResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeDownloadUrlExecutor* excutor = [[RedisDescribeDownloadUrlExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeDownloadUrlRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeDownloadUrlResponse* response = [[RedisDescribeDownloadUrlResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeCacheInstances sync request
@param describeCacheInstancesRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeCacheInstancesResponse` the request response data model
*/
-(NSDictionary*) describeCacheInstancesSyncWithRequest:(RedisDescribeCacheInstancesRequest*) describeCacheInstancesRequest
{
RedisDescribeCacheInstancesExecutor* excutor = [[RedisDescribeCacheInstancesExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeCacheInstancesRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeCacheInstancesResponse* response = [[RedisDescribeCacheInstancesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeCacheInstancesResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeCacheInstancesAsyncWithRequest:(RedisDescribeCacheInstancesRequest*) describeCacheInstancesRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeCacheInstancesResponse* _Nullable describeCacheInstancesResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeCacheInstancesExecutor* excutor = [[RedisDescribeCacheInstancesExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeCacheInstancesRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeCacheInstancesResponse* response = [[RedisDescribeCacheInstancesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeClusterInfo sync request
@param describeClusterInfoRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeClusterInfoResponse` the request response data model
*/
-(NSDictionary*) describeClusterInfoSyncWithRequest:(RedisDescribeClusterInfoRequest*) describeClusterInfoRequest
{
RedisDescribeClusterInfoExecutor* excutor = [[RedisDescribeClusterInfoExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeClusterInfoRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeClusterInfoResponse* response = [[RedisDescribeClusterInfoResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeClusterInfoResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeClusterInfoAsyncWithRequest:(RedisDescribeClusterInfoRequest*) describeClusterInfoRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeClusterInfoResponse* _Nullable describeClusterInfoResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeClusterInfoExecutor* excutor = [[RedisDescribeClusterInfoExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeClusterInfoRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeClusterInfoResponse* response = [[RedisDescribeClusterInfoResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
modifyCacheInstanceAttribute sync request
@param modifyCacheInstanceAttributeRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyCacheInstanceAttributeResponse` the request response data model
*/
-(NSDictionary*) modifyCacheInstanceAttributeSyncWithRequest:(RedisModifyCacheInstanceAttributeRequest*) modifyCacheInstanceAttributeRequest
{
RedisModifyCacheInstanceAttributeExecutor* excutor = [[RedisModifyCacheInstanceAttributeExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyCacheInstanceAttributeRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyCacheInstanceAttributeResponse* response = [[RedisModifyCacheInstanceAttributeResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyCacheInstanceAttributeResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyCacheInstanceAttributeAsyncWithRequest:(RedisModifyCacheInstanceAttributeRequest*) modifyCacheInstanceAttributeRequest
                       completionHandler:(void(^)(int statusCode,RedisModifyCacheInstanceAttributeResponse* _Nullable modifyCacheInstanceAttributeResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisModifyCacheInstanceAttributeExecutor* excutor = [[RedisModifyCacheInstanceAttributeExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyCacheInstanceAttributeRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyCacheInstanceAttributeResponse* response = [[RedisModifyCacheInstanceAttributeResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeBackups sync request
@param describeBackupsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeBackupsResponse` the request response data model
*/
-(NSDictionary*) describeBackupsSyncWithRequest:(RedisDescribeBackupsRequest*) describeBackupsRequest
{
RedisDescribeBackupsExecutor* excutor = [[RedisDescribeBackupsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeBackupsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeBackupsResponse* response = [[RedisDescribeBackupsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeBackupsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeBackupsAsyncWithRequest:(RedisDescribeBackupsRequest*) describeBackupsRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeBackupsResponse* _Nullable describeBackupsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeBackupsExecutor* excutor = [[RedisDescribeBackupsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeBackupsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeBackupsResponse* response = [[RedisDescribeBackupsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeCacheInstance sync request
@param describeCacheInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeCacheInstanceResponse` the request response data model
*/
-(NSDictionary*) describeCacheInstanceSyncWithRequest:(RedisDescribeCacheInstanceRequest*) describeCacheInstanceRequest
{
RedisDescribeCacheInstanceExecutor* excutor = [[RedisDescribeCacheInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeCacheInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeCacheInstanceResponse* response = [[RedisDescribeCacheInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeCacheInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeCacheInstanceAsyncWithRequest:(RedisDescribeCacheInstanceRequest*) describeCacheInstanceRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeCacheInstanceResponse* _Nullable describeCacheInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeCacheInstanceExecutor* excutor = [[RedisDescribeCacheInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeCacheInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeCacheInstanceResponse* response = [[RedisDescribeCacheInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
modifyInstanceConfig sync request
@param modifyInstanceConfigRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyInstanceConfigResponse` the request response data model
*/
-(NSDictionary*) modifyInstanceConfigSyncWithRequest:(RedisModifyInstanceConfigRequest*) modifyInstanceConfigRequest
{
RedisModifyInstanceConfigExecutor* excutor = [[RedisModifyInstanceConfigExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyInstanceConfigRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyInstanceConfigResponse* response = [[RedisModifyInstanceConfigResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyInstanceConfigResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyInstanceConfigAsyncWithRequest:(RedisModifyInstanceConfigRequest*) modifyInstanceConfigRequest
                       completionHandler:(void(^)(int statusCode,RedisModifyInstanceConfigResponse* _Nullable modifyInstanceConfigResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisModifyInstanceConfigExecutor* excutor = [[RedisModifyInstanceConfigExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyInstanceConfigRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisModifyInstanceConfigResponse* response = [[RedisModifyInstanceConfigResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeInstanceClass sync request
@param describeInstanceClassRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeInstanceClassResponse` the request response data model
*/
-(NSDictionary*) describeInstanceClassSyncWithRequest:(RedisDescribeInstanceClassRequest*) describeInstanceClassRequest
{
RedisDescribeInstanceClassExecutor* excutor = [[RedisDescribeInstanceClassExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeInstanceClassRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeInstanceClassResponse* response = [[RedisDescribeInstanceClassResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeInstanceClassResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeInstanceClassAsyncWithRequest:(RedisDescribeInstanceClassRequest*) describeInstanceClassRequest
                       completionHandler:(void(^)(int statusCode,RedisDescribeInstanceClassResponse* _Nullable describeInstanceClassResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
RedisDescribeInstanceClassExecutor* excutor = [[RedisDescribeInstanceClassExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeInstanceClassRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    RedisDescribeInstanceClassResponse* response = [[RedisDescribeInstanceClassResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 redis common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) redisCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)redisCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
